<?php
namespace app\api\model\foodcash;

use app\common\model\Pact as PactModel;

class Pact extends PactModel
{
   /**
     * 添加预约餐桌
     */
    public function add($data)
    {
        $data['pact_type'] = 20;//订桌
        //上午
        if($data['time'] == 1){
            $data['pact_time'] = strtotime($data['pact_time'] . ' 06:00:00');
        }
        //中午
        if($data['time'] == 2){
            $data['pact_time'] = strtotime($data['pact_time'] . ' 12:00:00');
        }
        //晚上
        if($data['time'] == 3){
            $data['pact_time'] = strtotime($data['pact_time'] . ' 18:00:00');
        }
        return $this->save($data);
    }
}
